package com.mayikt.weixin.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.mayikt.base.BaseApiService;
import com.mayikt.base.BaseResponse;
import com.mayikt.member.output.dto.UserOutDTO;
import com.mayikt.member.service.MemberService;
import com.mayikt.weixin.feign.MemberServiceFeign;
import com.mayikt.weixin.service.WeiXinService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class WeiXinServiceImpl extends BaseApiService<JSONObject> implements WeiXinService {
    @Value("${mayikt.weixin.name}")
    private String name;
    @Autowired
    private MemberServiceFeign memberServiceFeign;
//    @Override
//    public BaseResponse<AppEntity> getApp() {
//        AppEntity appEntity = new AppEntity("Vince-ZZ", name);
//        return setResultSuccess(appEntity);
//    }
    @GetMapping("/checkMobile")
    public BaseResponse<JSONObject> checkMobile(){
        BaseResponse<UserOutDTO> userOutDTOBaseResponse = memberServiceFeign.existMobile("15685482010");

        JSONObject data = new JSONObject();
        data.put("data",userOutDTOBaseResponse);
        return setResultSuccess(data);
    }
}
